import java.rmi.RemoteException;

import javax.xml.rpc.ServiceException;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

/**
 * @author：刘东
 * @created: 2013-7-2 下午05:31:03 
 * @version：$Id$ 
 * @since:1.0
 * @copyright 
 *
 */

public class webServiceTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Service sv = new Service();
		String endpoint = "http://ServerName:port/portal.integeration/service/IntegrateService?wsdl";
		try {
			Call call = (Call) sv.createCall();
			call.setTargetEndpointAddress(endpoint);
			call.setOperationName("checkValue");//WSDL里面描述的接口名称
			//			call.addParameter("uId","Uid",javax.xml.rpc.ParameterMode.IN);//接口的参数
			call.addParameter("uId", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
			call.addParameter("sId", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
			call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);//设置返回类型
			String uid = "";
			String sid = "";
			//给方法传递参数，并且调用方法 System.out.println("result is "+result);
			String result = (String) call.invoke(new Object[] {
				uid, sid });
			System.out.println("result is "+result);
		} catch (ServiceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
